﻿#ifndef ZMQPUBLISHER_H
#define ZMQPUBLISHER_H

#include <QObject>
#include "zmq.h"
#include "myhead.h"
#include "basepublisher.h"

class ZmqPublisher : public BasePublisher
{
    Q_OBJECT
public:
    Q_INVOKABLE explicit ZmqPublisher(QObject *parent = nullptr);

signals:

public slots:

public:
    virtual bool connectToHost() override;
    virtual bool isConnected() override;
    virtual bool disConnect() override;

    // BasePublisher interface
public:
    virtual bool publish(QByteArray data) override;

private:
    void *_context =nullptr;
    void *_socket =nullptr;

public:
    virtual QWidget *getConfigWidget() override;
};

#endif // ZMQPUBLISHER_H
